package com.chuanke.ckfamily.service.util;

import com.weijie.core.extend.codebuilder.MybatisCRUDBuilder;

public class CKCRUDBuilder extends MybatisCRUDBuilder {

    @Override
    protected String getDaoClassName(String entityName) {
        int index = entityName.lastIndexOf(".");
        if (index == -1) {
            return entityName + "Dao";
        }

        String packName = entityName.substring(0, index);
        String simpleName = entityName.substring(index + 1);

        index = packName.lastIndexOf(".");
        if (index == -1) {
            return simpleName + "Dao";
        }

        return packName.substring(0, index + 1) + simpleName + "Dao";
    }
}
